import { AniTool } from "./Ipha_AniTool";
import { PosTool } from "./Ipha_PosTool";

/**
 * 一发私人定制工具
 */
export default class Ipha_tool {

    private static _posTool: PosTool = null;
    static get pos() {
        if (this._posTool == null) {
            this._posTool = new PosTool();
        }
        return this._posTool;
    }

    private static _aniTool: AniTool = null;
    static get ani() {
        if (this._aniTool == null) {
            this._aniTool = new AniTool();
        }
        return this._aniTool;
    }
}

/**
     * 一发类基础
    */
export abstract class Ipha_ClassBase {
    abstract _className: string;

    protected _Initialize() {
        console.log("---------", this._className, "------创建完毕");
    }

    protected clear() {
        console.log("---------", this._className, "------清除完毕");
    }
}

//设置 label.string 强制刷新方法

// let label = node.getComponent(cc.Label);
// label.string = singleStr;
//_forceUpdateRenderData(); 2.2及后的版本
//_updateRenderData(true); 2.1及之前版本用的

//@ts-ignore
// (<any>label)._forceUpdateRenderData();

// let width = label.node.getContentSize().width;